#!/bin/bash

# This script is needed on the client to perform
# the knocks. Directly after this script ssh-login
# to the server is possible for 3 seconds.

SERVER_IP=127.0.0.1   # <--- CHANGE TO SERVER IP-ADDRESS

knockports=$(~/bin/totp.lowres.py)
for port in $knockports ; do
    echo -n "$port "
    echo > /dev/udp/$SERVER_IP/$port ; sleep 0.3
done
echo

# vim:tw=0

